﻿using System.Text;
using jQueryCSharp.Helper;

namespace jQueryCSharp
{
    public enum TípoBotao
    {
        Radios,
        Checkboxes,
        Icons,
        Toolbar,
        SplitButton,
        Default
    }

    public class jQueryCSharpUIBuilder
    {
        private readonly StringBuilder _sb;

        public jQueryCSharpUIBuilder( )
        {
            _sb = new StringBuilder( );
        }

        internal void Append( string conteudo )
        {
            _sb.Append( conteudo );
        }

        public override string ToString( )
        {
            var sb = new StringBuilder( );

            sb.AppendLine( JavaScript.Begin );
            sb.AppendLine( "<!--" );
            sb.AppendLine( "$(document).ready(function () {" );
            //sb.AppendLine( "try {" );

            sb.AppendLine( _sb.ToString( ) );

            //sb.AppendLine( "} catch( e ) { }" );
            sb.AppendLine( "});" );
            sb.AppendLine( JavaScript.End );

            return sb.ToString( );
        }
    }
}
